package com.dbq.fast.business.main.dialog;

import com.dbq.fast.App;
import com.dbq.fast.R;
import com.dbq.fast.business.main.dialog.base.TipBaseDialog;


public class TipDialog extends TipBaseDialog {

    public static final int NO_NETWORK = 0x01;
    public static final int NO_VPN_SERVICE = 0x02;
    public static final int SERVICE_OUT_DATE = 0x03;
    public static final int GET_VPN_TIME_OUT = 0x04;
    public static final int ESTABLISH_VPN_FAILED = 0x05;
    public static final int UPLOAD_LOG_FEEDBACK = 0x06;
    public static final int PAY_FAIL_REWARD_TIP = 0x07;

    public static TipBaseDialog newInstance(int which) {
        DIALOG_TAG = "tip_dialog"+which;
        if(isShowing(DIALOG_TAG)) return null;
        joinMap(DIALOG_TAG);
        switch (which) {
            case NO_NETWORK:
                return new TipBaseDialog.Builder()
                        .setTipText(App.getContext().getString(R.string.tip_no_network))
                        .setOp1Text(App.getContext().getString(R.string.ok_left))
                        .setOp2Text("")
                        .setOp1Color(App.getContext().getResources().getColor(R.color.font_normal))
                        .setNeedCustomOp(false)
                        .build();
            case NO_VPN_SERVICE:
                return new TipBaseDialog.Builder()
                        .setTipText(App.getContext().getString(R.string.tip_retry_network_bad))
                        .setOp1Text(App.getContext().getString(R.string.ok_left)/*App.getContext().getString(R.string.cancel)*/)
                        .setOp2Text(""/*App.getContext().getString(R.string.retry)*/)
                        .setOp1Color(App.getContext().getResources().getColor(R.color.font_normal))
                        .setNeedCustomOp(false)
                        .build();
            case SERVICE_OUT_DATE:
                return new TipBaseDialog.Builder()
                        .setTipText(App.getContext().getString(R.string.tip_service_out_date))
                        .setOp1Text(App.getContext().getString(R.string.cancel))
                        .setOp2Text(App.getContext().getString(R.string.tip_go_buy))
                        .setOp1Color(App.getContext().getResources().getColor(R.color.font_grey))
                        .setNeedCustomOp(true)
                        .build();
            case GET_VPN_TIME_OUT:
                return new TipBaseDialog.Builder()
                        .setTipText(App.getContext().getString(R.string.tip_get_vpn_time_out))
                        .setOp1Text(App.getContext().getString(R.string.cancel))
                        .setOp2Text(App.getContext().getString(R.string.retry))
                        .setOp1Color(App.getContext().getResources().getColor(R.color.font_grey))
                        .setNeedCustomOp(true)
                        .build();
            case ESTABLISH_VPN_FAILED:
                return new TipBaseDialog.Builder()
                        .setTipText(App.getContext().getString(R.string.tip_establish_vpn_failed))
                        .setOp1Text(App.getContext().getString(R.string.tip_go_reboot_phone))
                        .setOp2Text("")
                        .setOp1Color(App.getContext().getResources().getColor(R.color.font_blue))
                        .setNeedCustomOp(false)
                        .build();
            case UPLOAD_LOG_FEEDBACK:
                return new TipBaseDialog.Builder()
                        .setTipText(App.getContext().getString(R.string.tip_upload_log_feedback))
                        .setOp1Text(App.getContext().getString(R.string.close))
                        .setOp2Text("")
                        .setOp1Color(App.getContext().getResources().getColor(R.color.font_normal))
                        .setNeedCustomOp(false)
                        .build();
            case PAY_FAIL_REWARD_TIP:
                return new TipBaseDialog.Builder()
                        .setTipText(App.getContext().getString(R.string.reward_dialog_content))
                        .setOp1Text(App.getContext().getString(R.string.cancel))
                        .setOp2Text(App.getContext().getString(R.string.reward_dialog_op2))
                        .setOp1Color(App.getContext().getResources().getColor(R.color.font_grey))
                        .setNeedCustomOp(true)
                        .build();
            default:
                return null;
        }
    }


}
